<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE>Readme for basic ioc gps example</TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Linux)">
	<META NAME="AUTHOR" CONTENT="kejin">
	<META NAME="CREATED" CONTENT="20061120;17150100">
	<META NAME="CHANGEDBY" CONTENT="kejin">
	<META NAME="CHANGED" CONTENT="20071011;23555900">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 8.5in 11in; margin: 0.79in }
		P { margin-bottom: 0.08in }
		H2 { color: #000000 }
		H3 { color: #000000 }
		PRE { color: #000000 }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H2>PocoCapsule/C++ example: Basic-IoC GPS</H2>
<P>Copyright(c) 2006 by <A HREF="http://www.pocomatic.com/">Pocomatic
Software</A>. All rights reserved.</P>
<P>This example was originated from an <A HREF="http://www.omg.org/news/meetings/workshops/RT_2003_Manual/Tutorials/T3_CCM_Wang-Rodrigues.pdf">OMG's
tutorial</A> designed for CORBA Component Model (CCM). It models a
GPS instrument consists of the following three components implemented
as Plain Old C++ objects (POCO) and wired together, as illustrated in
the diagram below: 
</P>
<UL>
	<LI><P><FONT SIZE=2>a tick pulse generator, implemented as
	</FONT><A HREF="TickGenImpl.h"><FONT SIZE=2>TickGenImpl</FONT></A><FONT SIZE=2>,
	generates clock pulses for the instrument, </FONT>
	</P>
	<LI><P><FONT SIZE=2>a GPS location device, implemented as
	</FONT><A HREF="GPSLocatorImpl.h"><FONT SIZE=2>GPSLocatorImp</FONT></A><FONT SIZE=2>l,
	locates the instruments current location and notifies subscribed
	displays on position update. </FONT>
	</P>
	<LI><P><FONT SIZE=2>a display device, implemented as </FONT><A HREF="NavDisplayImpl.h"><FONT SIZE=2>NavDisplayImpl</FONT></A><FONT SIZE=2>,
	retrieves location data from GPS and display them. </FONT>
	</P>
</UL>
<P><A HREF="gps.jpg"><IMG SRC="gps.jpg" NAME="GPS.JPG" ALIGN=LEFT WIDTH=661 HEIGHT=317 BORDER=0><BR CLEAR=LEFT></A>These
three components (beans) are instantiated, configured and wired up
inside a PocoCapsule/C++ IoC container using PocoCapsule/C++ IoC core
schema description <A HREF="setup.xml">setup.xml</A>. The same
example using a more express domain-specific-modeling (DSM) schema
can be found in the <A HREF="../../corba/gps/README.html">${POCOCAPSULE_DIR}/examples/corba/dsl-gps</A>
directory. 
</P>
<H3>Source Files</H3>
<P><A HREF="main.C">main.C:</A> This is a simple container used to
assemble the GPS application. N<FONT COLOR="#000000">otably, this
container itself is completely decoupled from application bean
implementations. It does not include/use their source code or link
with their binaries. </FONT>
</P>
<P><A HREF="Interfaces.h">Interfaces.h</A>: C++ interfaces (as pure
virtual C++ classes) definitions of component beans. Note: an
equivalent CORBA version of this example, that uses IDL to define
component interfaces, can be found in the
<A HREF="../../corba/gps/README.html">${POCOCAPSULE_DIR}/examples/corba/gps</A>
directory. 
</P>
<P><A HREF="TickGenImpl.h">TickGenImpl.h</A> and <A HREF="TickGenImpl.C">TickGenImpl.C:</A>
The implementation of tick generator device bean class. 
</P>
<P><A HREF="GPSLocatorImpl.h">GPSLocatorImpl.h</A> and
<A HREF="GPSLocatorImpl.C">GPSLocatorImpl.C:</A> The implementation
of GPS locator device bean class.</P>
<P><A HREF="NavDisplayImpl.h">NavDisplayImpl.h</A> and
<A HREF="NavDisplayImpl.C">NavDisplayImpl.C</A>: The implementation
of Navigate Display device bean class. <FONT COLOR="#000000">It is
also notable that above three application implementation POCO beans
themselves are container agnostic. It does not use, nor link with
PocoCapsule/C++ container runtime engine. They are plain old C++
objects can be developed and tested completely independent of and
unaware of PocoCapsule/C++ container. </FONT>
</P>
<P><A HREF="setup.xml">setup.xml:</A> The application context setup
descriptor that describes the configuration and wiring of the modeled
GPS application. 
</P>
<H3>Building this example</H3>
<P STYLE="font-weight: medium">To build this example, the environment
variable POCOCAPSULE_DIR should point to the PocoCapsule/C++
installed directory. Then, this example can be built by simply
invoking gmake/make on linux/unix or nmake on windows. 
</P>
<H3>Running this example</H3>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">Before
starting the application deployment container (i.e. the main
executable), make sure the LD_LIBRARY_PATH (on linux and solaris) or
the PATH (on windows) environment variable is set correctly to
include the ${POCOCAPSULE_DIR}/lib directory.</FONT></P>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">start
the main executable: </FONT>
</P>
<PRE STYLE="margin-left: 0.79in; margin-bottom: 0.2in"><B>prompt&gt;</B> main </PRE><P STYLE="margin-bottom: 0.2in">
<FONT FACE="Times New Roman">It will display GPS locations ... </FONT>
</P>
<P STYLE="margin-bottom: 0.2in"><A HREF="../../README.html"><FONT FACE="Times New Roman">Back
to the root page</FONT></A></P>
<P STYLE="margin-bottom: 0in"><BR>
</P>
<P STYLE="margin-bottom: 0in"><BR>
</P>
<P STYLE="margin-bottom: 0in"><BR>
</P>
</BODY>
</HTML>
